package gitee.cheungming.modules.governance.controller;

import cn.dev33.satoken.oauth2.annotation.SaCheckClientToken;
import cn.dev33.satoken.util.SaResult;
import gitee.cheungming.modules.governance.service.DeviceService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


/**
 * 设备
 *
 * @author cheungming cheungming@gmail.com
 * @since 1.0.0 2025-08-21
 */
@SaCheckClientToken
@RestController
@RequestMapping("api/device")
public class DeviceController {
    @Resource
    private DeviceService deviceService;

    @RequestMapping("getAll")
    public SaResult getAll() {
        return SaResult.data(deviceService.list(new HashMap<>()));
    }


    @RequestMapping("detail/{id}")
    public SaResult detail(@PathVariable Long id) {
        return SaResult.data(deviceService.get(id));
    }
}
